package com.acme.bankapp.service.bank;

import java.util.Arrays;

import com.acme.bankapp.domain.bank.Client;

public class Bank {
	private int countClients = 0;
	
	public int getCountClients() {
		return countClients;
	}
	
	public void addClient(Client client) throws Exception {
		if (countClients == MAX_CLIENTS)
			throw new Exception("The bank has already contains the maximum number of clients");
		clients[countClients] = client;
		countClients++;
	}
	
	public static final int MAX_CLIENTS = 10;
	
	private Client[] clients;
	
	public Bank() {
		clients = new Client[MAX_CLIENTS];
	}
	
	public Client[] getClients() {
		return Arrays.copyOf(clients,  countClients);
	}
}